from django.contrib import admin
from django.urls import path
from . import views
from .views import (
    MissionInfoListView, MissionInfoView, NextMissionView, MissionDetailInfoView,
    TaskGroupMissionsView, MissionDetailsBriefIntroView, LaunchSiteDetailView,
    LaunchStatisticsView, EncyclopediaGroupDetailView, LaunchSiteListView,
    InstitutionDetailView,
    KnowledgeQuestionView,  # 新增导入
    LaunchSiteMissionsView  # 新增导入
)

# 在导入部分添加
from .views import ArticleGroupDetailView

    
urlpatterns = [
    path('admin/', admin.site.urls),  # 添加 Django Admin 的路径
    path('', views.dashboard, name='index'),  # 直接使用dashboard作为首页
    path('articles/', views.article_list, name='article_list'),
    path('articles/new/', views.article_create, name='article_create'),
    path('article_group_detail/', ArticleGroupDetailView.as_view(), name='article_group_detail'),
    path('articles/<int:pk>/', views.article_detail, name='article_detail'),
    path('articles/<int:pk>/edit/', views.article_edit, name='article_edit'), 
    path('articles/<int:pk>/delete/', views.article_delete, name='article_delete'),
    path('missions/', views.mission_list, name='mission_list'),
    path('missions/new/', views.mission_create, name='mission_create'),
    path('missions/<int:pk>/edit/', views.mission_edit, name='mission_edit'), 
    path('mission/<int:pk>/copy/', views.mission_copy, name='mission_copy'),
    path('mission/<int:pk>/delete/', views.mission_delete, name='mission_delete'),
    path('mission_info_list/', MissionInfoListView.as_view(), name='mission-info-list'),
    path('mission_info/', MissionInfoView.as_view(), name='mission_detail_by_id'),
    path('next_mission_info/', NextMissionView.as_view(), name='next-mission'),
    path('mission_details/', MissionDetailInfoView.as_view(), name='mission_details'),
    path('related_group_missions/', TaskGroupMissionsView.as_view(), name='related_group_missions'),
    path('mission_details_brief_intro/', MissionDetailsBriefIntroView.as_view(), name='mission_details_brief_intro'),
    path('launch_site_detail/', LaunchSiteDetailView.as_view(), name='launch_site_detail'),
    path('launch_sites/', LaunchSiteListView.as_view(), name='launch_sites_list'),
    path('launch_statistics/', LaunchStatisticsView.as_view(), name='launch_statistics'),
    path('encyclopedia_group_detail/', EncyclopediaGroupDetailView.as_view(), name='encyclopedia_group_detail'),
    path('institution_detail/', InstitutionDetailView.as_view(), name='institution_detail'),  # 新增机构详情API
    path('knowledge_question/', KnowledgeQuestionView.as_view(), name='knowledge_question'),
    path('launch_site_missions/', LaunchSiteMissionsView.as_view(), name='launch_site_missions'),
]